package com.ali;

import com.ali.common.BeanName;
import com.ali.service.UserService;
import spring.MyAnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        MyAnnotationConfigApplicationContext myAnnotationConfigApplicationContext = new MyAnnotationConfigApplicationContext(ApplicationConfig.class);

        UserService userService = (UserService) myAnnotationConfigApplicationContext.getBean(BeanName.USER_SERVICE_IMPL);
        System.out.println(BeanName.USER_SERVICE_IMPL + "：" + userService);
        userService.test();

        System.out.println(BeanName.USER_SERVICE_IMPL + "：" + myAnnotationConfigApplicationContext.getBean(BeanName.USER_SERVICE_IMPL));
        System.out.println(BeanName.USER_SERVICE_IMPL + "：" + myAnnotationConfigApplicationContext.getBean(BeanName.USER_SERVICE_IMPL));
    }
}